package ch14;
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;

class _07_BufferedOutputStreamEx {
	public static void main(String args[]) {
		try {
		     FileOutputStream fos = new FileOutputStream("c:/123.txt");
	         BufferedOutputStream bos = new BufferedOutputStream(fos, 5);
		     
		     for(int i='1'; i <= '9'; i++) bos.write(i);
		     fos.close(); //[1]: 12345
		     //bos.close(); //[2]: 123456789
		     System.out.println("saved.");
		} catch (IOException e) {
		     e.printStackTrace();		
		}
	}
}